Filename | (eval 46)[/usr/share/perl5/Sub/Quote.pm:5] |
Statements | Executed 135 statements in 518µs |
Eval Invoked At | /usr/share/perl5/Sub/Quote.pm line 5 |
Sibling evals | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
10 | 2 | 2 | 128µs | 1.13ms | new | Method::Generate::Constructor::
1 | 1 | 1 | 15µs | 27µs | BEGIN@3.3 | Sub::Quote::
1 | 1 | 1 | 8µs | 8µs | BEGIN@6.4 | Method::Generate::Constructor::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | { | ||||
2 | 2 | 2µs | my $_QUOTED = ${$_[1]->{"\$_QUOTED"}}; | ||
3 | 2 | 62µs | 2 | 38µs | # spent 27µs (15+11) within Sub::Quote::BEGIN@3.3 which was called:
# once (15µs+11µs) by Sub::Quote::_clean_eval at line 3 # spent 27µs making 1 call to Sub::Quote::BEGIN@3.3
# spent 11µs making 1 call to warnings::unimport |
4 | # spent 1.13ms (128µs+1.00) within Method::Generate::Constructor::new which was called 10 times, avg 113µs/call:
# 9 times (114µs+1.00ms) by Moo::_constructor_maker_for at line 199 of Moo.pm, avg 124µs/call
# once (14µs+0s) by Moo::_constructor_maker_for at line 53 of Sub/Defer.pm | ||||
5 | package Method::Generate::Constructor; | ||||
6 | # spent 8µs within Method::Generate::Constructor::BEGIN@6.4 which was called:
# once (8µs+0s) by Sub::Quote::_clean_eval at line 11 | ||||
7 | 1 | 2µs | $^H = "2018"; | ||
8 | 1 | 500ns | ${^WARNING_BITS} = "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\003"; | ||
9 | 1 | 9µs | %^H = ( | ||
10 | ); | ||||
11 | 1 | 302µs | 1 | 8µs | } # spent 8µs making 1 call to Method::Generate::Constructor::BEGIN@6.4 |
12 | 9 | 3µs | my $class = shift; | ||
13 | 9 | 2µs | $class = ref($class) if ref($class); | ||
14 | 9 | 3µs | if ($class ne "Method::Generate::Constructor") { | ||
15 | if ($Moo::MAKERS{$class}) { | ||||
16 | Moo->_constructor_maker_for($class,"Method::Generate::Constructor"); | ||||
17 | return $class->new(@_); | ||||
18 | } elsif ($INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)) { | ||||
19 | return $meta->new_object($class->BUILDARGS(@_)); | ||||
20 | } | ||||
21 | } | ||||
22 | 9 | 1µs | my $args; | ||
23 | 9 | 9µs | if ( scalar @_ == 1 ) { | ||
24 | unless ( defined $_[0] && ref $_[0] eq 'HASH' ) { | ||||
25 | die "Single parameters to new() must be a HASH ref" | ||||
26 | ." data => ". $_[0] ."\n"; | ||||
27 | } | ||||
28 | $args = { %{ $_[0] } }; | ||||
29 | } | ||||
30 | elsif ( @_ % 2 ) { | ||||
31 | die "The new() method for $class expects a hash reference or a key/value list." | ||||
32 | . " You passed an odd number of arguments\n"; | ||||
33 | } | ||||
34 | else { | ||||
35 | 9 | 19µs | $args = {@_}; | ||
36 | } | ||||
37 | 9 | 9µs | my $new = bless({}, $class);; | ||
38 | 9 | 35µs | if (exists $args->{"accessor_generator"}) { | ||
39 | $new->{"accessor_generator"} = $args->{"accessor_generator"}; | ||||
40 | } | ||||
41 | 9 | 3µs | if (exists $args->{"attribute_specs"}) { | ||
42 | $new->{"attribute_specs"} = $args->{"attribute_specs"}; | ||||
43 | } | ||||
44 | 9 | 2µs | if (exists $args->{"construction_builder"}) { | ||
45 | $new->{"construction_builder"} = $args->{"construction_builder"}; | ||||
46 | } | ||||
47 | 9 | 3µs | if (exists $args->{"construction_string"}) { | ||
48 | $new->{"construction_string"} = $args->{"construction_string"}; | ||||
49 | } | ||||
50 | 9 | 6µs | if (exists $args->{"package"}) { | ||
51 | $new->{"package"} = $args->{"package"}; | ||||
52 | } | ||||
53 | 9 | 8µs | if (exists $args->{"subconstructor_handler"}) { | ||
54 | $new->{"subconstructor_handler"} = $args->{"subconstructor_handler"}; | ||||
55 | } | ||||
56 | 9 | 32µs | return $new; | ||
57 | } | ||||
58 | 1 | 1µs | $_QUOTED->[3] = \&Method::Generate::Constructor::new | ||
59 | } | ||||
60 | 1 | 5µs | 1; | ||
61 | |||||
62 | ; |